package org.jeecg.modules.wlhy.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.wlhy.customer.entity.HyCustomerAddressReceive;
import org.jeecg.modules.wlhy.order.entity.HyOrderReceiveAddress;
import org.jeecg.modules.wlhy.order.mapper.HyOrderReceiveAddressMapper;
import org.jeecg.modules.wlhy.order.service.IHyOrderReceiveAddressService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: hy_order_receive_address
 * @Author: jeecg-boot
 * @Date:   2021-09-10
 * @Version: V1.0
 */
@Service
public class HyOrderReceiveAddressServiceImpl extends ServiceImpl<HyOrderReceiveAddressMapper, HyOrderReceiveAddress> implements IHyOrderReceiveAddressService {

    @Override
    public void deleteByOrderId(String orderId) {
        baseMapper.deleteByOrderId(orderId);
    }

    @Override
    public List<HyOrderReceiveAddress> getListByOrderId(String orderId) {
        QueryWrapper<HyOrderReceiveAddress> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("order_id",orderId);
        List<HyOrderReceiveAddress> list = this.list(queryWrapper);
        return list;
    }

    @Override
    public List<HyCustomerAddressReceive> getShippingFenceByOrderId(String orderId) {
        return baseMapper.getShippingFenceByOrderId(orderId);
    }
}
